//
//  UIButton+Extension.swift
//  swiftWeiBo
//
//  Created by Johnray on 15/9/21.
//  Copyright © 2015年 Johnray. All rights reserved.
//

import UIKit

// MARK: - 便利构造button
extension UIButton{


    convenience init(imagename:String,bgImageName:String){
        self.init()
        
        
        setImage(UIImage(named: imagename), forState: UIControlState.Normal)
        
        setImage(UIImage(named: imagename + "_highlighted"), forState: UIControlState.Highlighted)
        
        setBackgroundImage(UIImage(named: bgImageName), forState: UIControlState.Normal)
        
        setBackgroundImage(UIImage(named: bgImageName + "_highlighted"), forState: UIControlState.Highlighted)
        
        sizeToFit()
        
        
    }
    
    
    
    

}


